package org.jackysoft.entity;

import java.util.Collection;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;


import com.google.common.collect.Lists;

@Entity
public class WorkflowSetting extends AbstractNoIdEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6238309906424246922L;

	private WorkflowSettingPK id;
	private String user;
	private Collection<Department> departments = Lists.newArrayList();
	private Collection<Role> roles = Lists.newArrayList();

	@Id
	public WorkflowSettingPK getId() {
		return id;
	}
	
	
	public void setId(WorkflowSettingPK id) {
		this.id = id;
	}

	
	public void setDepartments(Collection<Department> departments) {
		this.departments = departments;
	
	}

	@ManyToMany
	public Collection<Department> getDepartments() {
		return departments;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public void setRoles(Collection<Role> role) {
		this.roles = role;
	}

	@ManyToMany
	public Collection<Role> getRoles() {
		return roles;
	}
	
	
}
